﻿using Microsoft.Extensions.DependencyInjection;
using Swashbuckle.AspNetCore.Swagger;
using System;
using System.IO;
using System.Reflection;
#pragma warning disable CS1591
namespace Core.SimpleTemp.Api.Swagger
{

    public static class SwaggerServiceCollectionExtensions
    {
        public static void AddSwaggerService(this IServiceCollection services)
        {
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("Sys", new Info
                {
                    Version = "V1",
                    Title = "Core.SimpleTemp-Vue API",
                    Description = "Core.SimpleTemp 点击下方进入↓↓↓↓↓使用说明(PWD:123456)",
                    TermsOfService = "http://132.232.18.92:8181/web/#/1",

                });
  
                c.SwaggerDoc("Mobile", new Info
                {
                    Version = "v1",
                    Title = "Mobile API",
                    Description = "移动端接口 点击下方进入↓↓↓↓↓使用说明(PWD:123456)",
                    TermsOfService = "http://132.232.18.92:8181/web/#/2",
                });
                c.SwaggerDoc("YH", new Info
                {
                    Version = "v1",
                    Title = "YH隐患管理",
                    Description = "YH隐患管理接口 点击下方进入↓↓↓↓↓使用说明(PWD:123456)",
                    TermsOfService = "http://132.232.18.92:8181/web/#/3",
                });
                var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.XML";
                var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
                c.IncludeXmlComments(xmlPath);
            });
        }
    }
}
